//3. 定义一个计算图形面积的类，类中定义计算面积的方法：分别计算圆面积和长方形面积两个方法。
public class Area {
    private double a;
    private double b;
    private double r;

    public void RectangleArea(double a, double b) {
        this.a = a;
        this.b = b;
        System.out.println("长方形的面积：" + a * b);
    }

    public void RoundArea(double r) {
        this.r = r;
        System.out.println("圆的面积：" + Math.PI * r * r);

    }
}

class TestArea {
    public static void main(String[] args) {
        Area area = new Area();
        area.RectangleArea(2, 4);
        area.RoundArea(2);
    }
}
